import type { Meta, StoryObj } from "@storybook/react";
import React from "react";
import KxWarningDataLineChart from "./index";

const meta = {
  title: "折线图/可信预警分析-KxWarningDataLineChart",
  component: KxWarningDataLineChart,
  tags: ["autodocs"],
  argTypes: {},
  decorators: [
    (Story) => (
      <div
        style={{ backgroundColor: "#06112B", height: "469px", width: "909px" }}
      >
        <Story />
      </div>
    ),
  ],
} satisfies Meta<typeof KxWarningDataLineChart>;

export default meta;
type Story = StoryObj<typeof meta>;

export const basic: Story = {
  args: {
    dates: [
      "2021-07",
      "2021-08",
      "2021-09",
      "2021-10",
      "2021-11",
      "2021-12",
      "2022-01",
      "2022-02",
      "2022-03",
      "2022-04",
      "2022-05",
      "2022-06",
    ],
    seriesMap: {
      progress: "进度",
      quality: "质量",
      safety: "安全",
    },
    progress: [2, 2, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0],
    quality: [7, 5, 5, 7, 6, 5, 2, 2, 2, 2, 1, 2],
    safety: [14, 9, 9, 8, 7, 7, 2, 0, 0, 0, 0, 0],
  },
};

export const env7: Story = {
  args: {
    height: "469px",
    dates: [
      "3月1日",
      "3月2日",
      "3月3日",
      "3月4日",
      "3月5日",
      "3月6日",
      "3月7日",
    ],
    seriesMap: {
      pm: "PM2.5",
      noise: "噪声",
      tsp: "TSP",
      tem: "户外温度",
    },
    pm: [3, 32, 20, 25, 18, 24, 19],
    noise: [40, 50, 30, 40, 51, 55, 50],
    tsp: [86, 78, 42, 48, 27, 41, 20],
    tem: [1, 16, 2, 18, 6, 18, 19],
  },
};

export const qua7: Story = {
  args: {
    height: "469px",
    dates: [
      "3月1日",
      "3月2日",
      "3月3日",
      "3月4日",
      "3月5日",
      "3月6日",
      "3月7日",
    ],
    seriesMap: {
      quaCorrect: "质量逾期整改",
      quaRecheck: "质量逾期复检",
      safCorrect: "安全逾期整改",
      safRecheck: "安全逾期复检",
    },
    quaCorrect: [3, 32, 20, 25, 18, 24, 19],
    quaRecheck: [40, 50, 30, 40, 51, 55, 50],
    safCorrect: [86, 78, 42, 48, 27, 41, 20],
    safRecheck: [1, 16, 2, 18, 6, 18, 19],
  },
};
